package com.zhou.juc.test12_RefTypeAndThreadLocal;

import java.lang.ref.SoftReference;

/**
 * @author zhouyanxiang
 * @create 2020-08-2020/8/16-16:49
 */
public class T02_SoftReference {

    public static void main(String[] args) {
        SoftReference <byte[]> m = new SoftReference<>(new byte[1024 * 1024 * 10]);

        System.out.println(m.get());
        System.gc();

        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        System.out.println(m.get());
        byte[] bytes = new byte[1024 * 1024 * 15];
        System.out.println(m.get());
    }

}
